/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bsc.war.populate;

import bsc.ejb.entity.Comparator;
import bsc.ejb.entity.ComparatorDimensionalCut;
import bsc.ejb.entity.Dimension;
import bsc.ejb.entity.DimensionMember;
import bsc.ejb.entity.DimensionalCut;
import bsc.ejb.entity.DimensionalCutMember;
import bsc.ejb.entity.Label;
import bsc.ejb.entity.Map;
import bsc.ejb.entity.Milestone;
import bsc.ejb.entity.MilestoneTracer;
import bsc.ejb.entity.Objective;
import bsc.ejb.entity.Person;
import bsc.ejb.entity.Perspective;
import bsc.ejb.entity.Pointer;
import bsc.ejb.entity.Project;
import bsc.ejb.entity.ScoreCardDimension;
import bsc.ejb.entity.ScoreCardRelation;
import bsc.ejb.entity.ScoreDomain;
import bsc.ejb.entity.Settings;
import bsc.ejb.entity.Theme;
import bsc.ejb.entity.Tracer;
import bsc.ejb.metadata.Colorimetry;
import bsc.ejb.metadata.Comparation;
import bsc.ejb.metadata.Framework;
import bsc.ejb.metadata.MapDrawing;
import bsc.war.delegate.DelegateBSC;
import bsc.war.factory.Factory;
import bsc.war.service.ScoreCardUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

/**
 *
 * @author luisZavaleta
 */
public class OaxacaPopulate extends AbstractController {

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        DelegateBSC delegate = (DelegateBSC) Factory.getBean("DelegateBSC");


        //Se crea un FrameWork
        try {

            createFramework(request, response, delegate);
        } catch (Exception e) {
            e.printStackTrace();
        }





        return new ModelAndView("advancePopulate");
    }

    public static void createFramework(HttpServletRequest request,
            HttpServletResponse response, DelegateBSC delegate) {

        //Create a Framework
        Framework framework = (Framework) Factory.getBean("Framework");
        framework.setName("Néctares del Sureste");
        framework.setDescription("Framework de Trabajo para Néctares del Surests");
        framework.setActive(Boolean.TRUE);

        delegate.createFramework(framework);

        //Create a Colorimetries
        //Green
        Colorimetry colorimetryGreen = (Colorimetry) Factory.getBean("Colorimetry");
        colorimetryGreen.setName("Green");
        colorimetryGreen.setPriority(1);
        colorimetryGreen.setFramework(framework);
        colorimetryGreen.setColor("00FF00");
        delegate.createColorimetry(colorimetryGreen);

        //Yellow
        Colorimetry colorimetryYellow = (Colorimetry) Factory.getBean("Colorimetry");
        colorimetryYellow.setName("Yellow");
        colorimetryYellow.setPriority(2);
        colorimetryYellow.setFramework(framework);
        colorimetryYellow.setColor("FFFF00");
        delegate.createColorimetry(colorimetryYellow);

        //Red
        Colorimetry colorimetryRed = (Colorimetry) Factory.getBean("Colorimetry");
        colorimetryRed.setName("Red");
        colorimetryRed.setPriority(3);
        colorimetryRed.setFramework(framework);
        colorimetryRed.setColor("FF0000");
        delegate.createColorimetry(colorimetryRed);

        //Create Map Drawing
        MapDrawing mapDrawing = (MapDrawing) Factory.getBean("MapDrawing");
        mapDrawing.setName("Dibujo del Mapa de Gobierno de Oaxaca");
        mapDrawing.setFile("/files/bsc/map/PED.jpg");
        mapDrawing.setFramework(framework);
        delegate.createMapDrawing(mapDrawing);

        //Create Map Drawing2
        MapDrawing mapDrawing2 = (MapDrawing) Factory.getBean("MapDrawing");
        mapDrawing2.setName("Dibujo del Mapa de Gobierno de Oaxaca - SS");
        mapDrawing2.setFile("/files/bsc/map/MapaOaxaca.jpg");
        mapDrawing2.setFramework(framework);
        delegate.createMapDrawing(mapDrawing2);


        //Create Comparation
        Comparation comparationReal = (Comparation) Factory.getBean("Comparation");
        comparationReal.setName("Real");
        comparationReal.setType(Comparation.Type.REAL);
        comparationReal.setFramework(framework);

        Comparation comparationGoal = (Comparation) Factory.getBean("Comparation");
        comparationGoal.setName("Meta");
        comparationGoal.setType(Comparation.Type.GOAL);
        comparationGoal.setFramework(framework);

        delegate.createComparation(comparationReal);
        delegate.createComparation(comparationGoal);

        //Se inicia la creación del MODELO

        //DIMENSIONES
        //DIMENSION TOTAL
        //Populate a new Dimension
        Dimension dimensionNormal = (Dimension) Factory.getBean("Dimension");
        dimensionNormal.setName("NORMAL");
        delegate.createDimension(dimensionNormal);

        //Populate a new Member
        DimensionMember dimensionmember1Normal = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember1Normal.setName("TOTAL");
        dimensionmember1Normal.setDimension(dimensionNormal);
        delegate.createDimensionMember(dimensionmember1Normal);


        //DIMENSION PRODUCTOS
        //Populate a new Dimension
        Dimension dimensionProductos = (Dimension) Factory.getBean("Dimension");
        dimensionProductos.setName("PRODUCTOS");
        delegate.createDimension(dimensionProductos);

        //Populate a new Member
        DimensionMember dimensionmember1Productos = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember1Productos.setName("TOTAL_PRODUCTOS");
        dimensionmember1Productos.setDimension(dimensionProductos);
        delegate.createDimensionMember(dimensionmember1Productos);

        DimensionMember dimensionmember2Productos = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember2Productos.setName("Cien_Néctar");
        dimensionmember2Productos.setDimension(dimensionProductos);
        dimensionmember2Productos.setDimensionMember(dimensionmember1Productos);
        delegate.createDimensionMember(dimensionmember2Productos);

        DimensionMember dimensionmember3Productos = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember3Productos.setName("Néctar_Cero");
        dimensionmember3Productos.setDimension(dimensionProductos);
        dimensionmember3Productos.setDimensionMember(dimensionmember1Productos);
        delegate.createDimensionMember(dimensionmember3Productos);

        DimensionMember dimensionmember4Productos = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember4Productos.setName("Nectarín");
        dimensionmember4Productos.setDimension(dimensionProductos);
        dimensionmember4Productos.setDimensionMember(dimensionmember1Productos);
        delegate.createDimensionMember(dimensionmember4Productos);


        //DIMENSION SISTEMAS
        //Populate a new Dimension
        Dimension dimensionSistemas = (Dimension) Factory.getBean("Dimension");
        dimensionSistemas.setName("SISTEMAS_INFORMACIÓN");
        delegate.createDimension(dimensionSistemas);

        //Populate a new Member
        DimensionMember dimensionmember1Sistemas = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember1Sistemas.setName("TOTAL_SISTEMAS_INFORMACIÓN");
        dimensionmember1Sistemas.setDimension(dimensionSistemas);
        delegate.createDimensionMember(dimensionmember1Sistemas);

        DimensionMember dimensionmember2Sistemas = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember2Sistemas.setName("ERP");
        dimensionmember2Sistemas.setDimension(dimensionSistemas);
        dimensionmember2Sistemas.setDimensionMember(dimensionmember1Sistemas);
        delegate.createDimensionMember(dimensionmember2Sistemas);

        DimensionMember dimensionmember3Sistemas = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember3Sistemas.setName("CRM");
        dimensionmember3Sistemas.setDimension(dimensionSistemas);
        dimensionmember3Sistemas.setDimensionMember(dimensionmember1Sistemas);
        delegate.createDimensionMember(dimensionmember3Sistemas);

        DimensionMember dimensionmember4Sistemas = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember4Sistemas.setName("CONTROL_DE_PISO");
        dimensionmember4Sistemas.setDimension(dimensionSistemas);
        dimensionmember4Sistemas.setDimensionMember(dimensionmember1Sistemas);
        delegate.createDimensionMember(dimensionmember4Sistemas);


        //DIMENSION REGIONES
        //Populate a new Dimension
        Dimension dimensionRegiones = (Dimension) Factory.getBean("Dimension");
        dimensionRegiones.setName("REGIONES");
        delegate.createDimension(dimensionRegiones);

        //Populate a new Member
        DimensionMember dimensionmember1Regiones = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember1Regiones.setName("TOTAL_REGIONES");
        dimensionmember1Regiones.setDimension(dimensionRegiones);
        delegate.createDimensionMember(dimensionmember1Regiones);

        DimensionMember dimensionmember2Regiones = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember2Regiones.setName("Sierra_Norte");
        dimensionmember2Regiones.setDimension(dimensionRegiones);
        dimensionmember2Regiones.setDimensionMember(dimensionmember1Regiones);
        delegate.createDimensionMember(dimensionmember2Regiones);

        DimensionMember dimensionmember3Regiones = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember3Regiones.setName("Sierra_Sur");
        dimensionmember3Regiones.setDimension(dimensionRegiones);
        dimensionmember3Regiones.setDimensionMember(dimensionmember1Regiones);
        delegate.createDimensionMember(dimensionmember3Regiones);

        DimensionMember dimensionmember4Regiones = (DimensionMember) Factory.getBean("DimensionMember");
        dimensionmember4Regiones.setName("Itsmo");
        dimensionmember4Regiones.setDimension(dimensionRegiones);
        dimensionmember4Regiones.setDimensionMember(dimensionmember1Regiones);
        delegate.createDimensionMember(dimensionmember4Regiones);



        //INDICADORES



        //INDICADORES
        //---------------------------INDICADOR FSA--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFSA = (Pointer) Factory.getBean("Pointer");
        pointerFSA.setName("FS. Agua de calidad bacteriológica");
        pointerFSA.setDescription("Disminuir los riesgos a la salud, derivados del contacto con el suelo, aire y agua");
        pointerFSA.setResponsable("Eduardo Romero");
        pointerFSA.setUnit("(#)");
        delegate.createPointer(pointerFSA);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFSA = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFSA.setScoreCard(pointerFSA);
        scorecarddimensionFSA.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFSA);

        //Populate a new Comparador Real
        Comparator comparatorRFSA = (Comparator) Factory.getBean("Comparator");
        comparatorRFSA.setDescription("Real");
        comparatorRFSA.setComparation(comparationReal);
        comparatorRFSA.setPointer(pointerFSA);
        delegate.createComparator(comparatorRFSA);

        //Populate a new Comparador Meta
        Comparator comparatorMFSA = (Comparator) Factory.getBean("Comparator");
        comparatorMFSA.setDescription("Meta");
        comparatorMFSA.setComparation(comparationGoal);
        comparatorMFSA.setPointer(pointerFSA);
        delegate.createComparator(comparatorMFSA);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFSA = delegate.findComparator(pointerFSA, comparationReal);
        Long idComparatorFSA = comparatorFSA.getIdComparator();

        //Create setting to that pointer
        Settings settingFSA = (Settings) Factory.getBean("Settings");
        settingFSA.setType(Settings.Type.SCORECARD);
        settingFSA.setTemporality(Settings.Temporality.LAST);
        settingFSA.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFSA.setMathOperation("C" + idComparatorFSA + "/P");

        settingFSA.setScoreCard(pointerFSA);
        delegate.createSettings(settingFSA);

        pointerFSA.setSettings(settingFSA);
        delegate.updatePointer(pointerFSA);


        //Settings de los comparators

        List<Comparator> comparatorsFSA = delegate.findComparator(pointerFSA);
        for (Comparator comparator1 : comparatorsFSA) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FSA = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FSA.setPointer(pointerFSA);
        dimensionalcut1FSA.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FSA);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFSA = new ArrayList<DimensionalCut>();
        dimensionalCutsFSA.add(dimensionalcut1FSA);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FSA = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FSA.setDimensionMember(dimensionmember1Normal);
        dcm1FSA.setDimensionalCut(dimensionalcut1FSA);
        delegate.createDimensionalCutMember(dcm1FSA);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFSA[][] = {{732D},
            {792D},
            {701D},
            {786D},
            {701D},
            {720D},
            {705D}
        };


        Double metaValuesFSA[][] = {{858D},
            {859D},
            {859D},
            {859D},
            {859D},
            {859D},
            {859D}
        };


        //Se crean las FECHAS

        List<Date> datesFSA = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFSA);
        System.out.println("Indicador: " + pointerFSA.getName());
        for (int i = 0; i < datesFSA.size(); i++) {
            System.out.println("Fecha Generada: " + datesFSA.get(i));
            for (int j = 0; j < dimensionalCutsFSA.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFSA = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFSA.setComparator(comparatorRFSA);
                cdcRealFSA.setDimensionalCut(dimensionalCutsFSA.get(j));
                cdcRealFSA.setRegisterDate(datesFSA.get(i));
                cdcRealFSA.setRegister(realValuesFSA[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFSA);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFSA = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFSA.setComparator(comparatorMFSA);
                cdcMetaFSA.setDimensionalCut(dimensionalCutsFSA.get(j));
                cdcMetaFSA.setRegisterDate(datesFSA.get(i));
                cdcMetaFSA.setRegister(metaValuesFSA[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFSA);

            }
        }
        //INDICADORES
        //---------------------------FIN FSA--------------------------------------------------------------------------------------


        //---------------------------INDICADOR FNA--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFNA = (Pointer) Factory.getBean("Pointer");
        pointerFNA.setName("FN. Agua de calidad bacteriológica");
        pointerFNA.setDescription("Disminuir los riesgos a la salud, derivados del contacto con el suelo, aire y agua");
        pointerFNA.setResponsable("Eduardo Romero");
        pointerFNA.setUnit("($)");
        delegate.createPointer(pointerFNA);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFNA = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFNA.setScoreCard(pointerFNA);
        scorecarddimensionFNA.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFNA);

        //Populate a new Comparador Real
        Comparator comparatorRFNA = (Comparator) Factory.getBean("Comparator");
        comparatorRFNA.setDescription("Real");
        comparatorRFNA.setComparation(comparationReal);
        comparatorRFNA.setPointer(pointerFNA);
        delegate.createComparator(comparatorRFNA);

        //Populate a new Comparador Meta
        Comparator comparatorMFNA = (Comparator) Factory.getBean("Comparator");
        comparatorMFNA.setDescription("Meta");
        comparatorMFNA.setComparation(comparationGoal);
        comparatorMFNA.setPointer(pointerFNA);
        delegate.createComparator(comparatorMFNA);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFNA = delegate.findComparator(pointerFNA, comparationReal);
        Long idComparatorFNA = comparatorFNA.getIdComparator();

        //Create setting to that pointer
        Settings settingFNA = (Settings) Factory.getBean("Settings");
        settingFNA.setType(Settings.Type.SCORECARD);
        settingFNA.setTemporality(Settings.Temporality.LAST);
        settingFNA.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFNA.setPolarity(Settings.Polarity.SPECIAL);
        settingFNA.setMathOperation("C" + idComparatorFNA + "/P");
        settingFNA.setSpecialOperation("2-C" + idComparatorFNA + "/P");



        settingFNA.setScoreCard(pointerFNA);
        delegate.createSettings(settingFNA);

        pointerFNA.setSettings(settingFNA);
        delegate.updatePointer(pointerFNA);


        //Settings de los comparators

        List<Comparator> comparatorsFNA = delegate.findComparator(pointerFNA);
        for (Comparator comparator1 : comparatorsFNA) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FNA = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FNA.setPointer(pointerFNA);
        dimensionalcut1FNA.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FNA);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFNA = new ArrayList<DimensionalCut>();
        dimensionalCutsFNA.add(dimensionalcut1FNA);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FNA = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FNA.setDimensionMember(dimensionmember1Normal);
        dcm1FNA.setDimensionalCut(dimensionalcut1FNA);
        delegate.createDimensionalCutMember(dcm1FNA);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFNA[][] = {{40613D},
            {41082D},
            {40742D},
            {42970D},
            {41941D},
            {43016D},
            {41043D}
        };


        Double metaValuesFNA[][] = {{47504D},
            {47510D},
            {47510D},
            {47510D},
            {47510D},
            {47510D},
            {47510D}
        };


        //Se crean las FECHAS

        List<Date> datesFNA = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFNA);
        System.out.println("Indicador: " + pointerFNA.getName());
        for (int i = 0; i < datesFNA.size(); i++) {
            System.out.println("Fecha Generada: " + datesFNA.get(i));
            for (int j = 0; j < dimensionalCutsFNA.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFNA = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFNA.setComparator(comparatorRFNA);
                cdcRealFNA.setDimensionalCut(dimensionalCutsFNA.get(j));
                cdcRealFNA.setRegisterDate(datesFNA.get(i));
                cdcRealFNA.setRegister(realValuesFNA[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFNA);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFNA = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFNA.setComparator(comparatorMFNA);
                cdcMetaFNA.setDimensionalCut(dimensionalCutsFNA.get(j));
                cdcMetaFNA.setRegisterDate(datesFNA.get(i));
                cdcMetaFNA.setRegister(metaValuesFNA[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFNA);

            }
        }
        //INDICADORES
        //---------------------------FIN FNA--------------------------------------------------------------------------------------




        //---------------------------INDICADOR FSD--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFSD = (Pointer) Factory.getBean("Pointer");
        pointerFSD.setName("FS. Prevención y detección de la diabetes mellitus");
        pointerFSD.setDescription("Prevenir y detectar la Diabetes Mellitus");
        pointerFSD.setResponsable("Jorge Villagrán");
        pointerFSD.setUnit("(Casos)");
        delegate.createPointer(pointerFSD);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFSD = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFSD.setScoreCard(pointerFSD);
        scorecarddimensionFSD.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFSD);

        //Populate a new Comparador Real
        Comparator comparatorRFSD = (Comparator) Factory.getBean("Comparator");
        comparatorRFSD.setDescription("Real");
        comparatorRFSD.setComparation(comparationReal);
        comparatorRFSD.setPointer(pointerFSD);
        delegate.createComparator(comparatorRFSD);

        //Populate a new Comparador Meta
        Comparator comparatorMFSD = (Comparator) Factory.getBean("Comparator");
        comparatorMFSD.setDescription("Meta");
        comparatorMFSD.setComparation(comparationGoal);
        comparatorMFSD.setPointer(pointerFSD);
        delegate.createComparator(comparatorMFSD);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFSD = delegate.findComparator(pointerFSD, comparationReal);
        Long idComparatorFSD = comparatorFSD.getIdComparator();

        //Create setting to that pointer
        Settings settingFSD = (Settings) Factory.getBean("Settings");
        settingFSD.setType(Settings.Type.SCORECARD);
        settingFSD.setTemporality(Settings.Temporality.LAST);
        settingFSD.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFSD.setMathOperation("P/" + "C" + idComparatorFSD);
        //settingFSD.setMathOperation("C" + idComparatorFSD+"/P < 1 ? C" + idComparatorFSD+"/P : 2 - C" + idComparatorFSD+"/P");


        settingFSD.setScoreCard(pointerFSD);
        delegate.createSettings(settingFSD);

        pointerFSD.setSettings(settingFSD);
        delegate.updatePointer(pointerFSD);


        //Settings de los comparators

        List<Comparator> comparatorsFSD = delegate.findComparator(pointerFSD);
        for (Comparator comparator1 : comparatorsFSD) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FSD = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FSD.setPointer(pointerFSD);
        dimensionalcut1FSD.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FSD);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFSD = new ArrayList<DimensionalCut>();
        dimensionalCutsFSD.add(dimensionalcut1FSD);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FSD = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FSD.setDimensionMember(dimensionmember1Normal);
        dcm1FSD.setDimensionalCut(dimensionalcut1FSD);
        delegate.createDimensionalCutMember(dcm1FSD);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFSD[][] = {{26540D},
            {31273D},
            {30469D},
            {30149D},
            {31227D},
            {32440D},
            {34545D}
        };


        Double metaValuesFSD[][] = {{25523D},
            {25523D},
            {25523D},
            {25523D},
            {25523D},
            {25523D},
            {25523D}
        };



        //Se crean las FECHAS

        List<Date> datesFSD = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFSD);
        System.out.println("Indicador: " + pointerFSD.getName());
        for (int i = 0; i < datesFSD.size(); i++) {
            System.out.println("Fecha Generada: " + datesFSD.get(i));
            for (int j = 0; j < dimensionalCutsFSD.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFSD = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFSD.setComparator(comparatorRFSD);
                cdcRealFSD.setDimensionalCut(dimensionalCutsFSD.get(j));
                cdcRealFSD.setRegisterDate(datesFSD.get(i));
                cdcRealFSD.setRegister(realValuesFSD[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFSD);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFSD = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFSD.setComparator(comparatorMFSD);
                cdcMetaFSD.setDimensionalCut(dimensionalCutsFSD.get(j));
                cdcMetaFSD.setRegisterDate(datesFSD.get(i));
                cdcMetaFSD.setRegister(metaValuesFSD[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFSD);

            }
        }
        //INDICADORES
        //---------------------------FIN FSD--------------------------------------------------------------------------------------


        //---------------------------INDICADOR FND--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFND = (Pointer) Factory.getBean("Pointer");
        pointerFND.setName("FN. Prevención y detección de la diabetes mellitus");
        pointerFND.setDescription("Prevenir y detectar la Diabetes Mellitus");
        pointerFND.setResponsable("Jorge Villagrán");
        pointerFND.setUnit("($)");
        delegate.createPointer(pointerFND);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFND = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFND.setScoreCard(pointerFND);
        scorecarddimensionFND.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFND);

        //Populate a new Comparador Real
        Comparator comparatorRFND = (Comparator) Factory.getBean("Comparator");
        comparatorRFND.setDescription("Real");
        comparatorRFND.setComparation(comparationReal);
        comparatorRFND.setPointer(pointerFND);
        delegate.createComparator(comparatorRFND);

        //Populate a new Comparador Meta
        Comparator comparatorMFND = (Comparator) Factory.getBean("Comparator");
        comparatorMFND.setDescription("Meta");
        comparatorMFND.setComparation(comparationGoal);
        comparatorMFND.setPointer(pointerFND);
        delegate.createComparator(comparatorMFND);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFND = delegate.findComparator(pointerFND, comparationReal);
        Long idComparatorFND = comparatorFND.getIdComparator();

        //Create setting to that pointer
        Settings settingFND = (Settings) Factory.getBean("Settings");
        settingFND.setType(Settings.Type.SCORECARD);
        settingFND.setTemporality(Settings.Temporality.LAST);
        settingFND.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFND.setPolarity(Settings.Polarity.SPECIAL);
        settingFND.setMathOperation("C" + idComparatorFND + "/P");
        settingFND.setSpecialOperation("2-C" + idComparatorFND + "/P");
        //ESPECIAL!!!!
        //settingFND.setMathOperation("C" + idComparatorFND+"/P < 1 ? C" + idComparatorFND+"/P : 2 - C" + idComparatorFND+"/P");


        settingFND.setScoreCard(pointerFND);
        delegate.createSettings(settingFND);

        pointerFND.setSettings(settingFND);
        delegate.updatePointer(pointerFND);


        //Settings de los comparators

        List<Comparator> comparatorsFND = delegate.findComparator(pointerFND);
        for (Comparator comparator1 : comparatorsFND) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FND = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FND.setPointer(pointerFND);
        dimensionalcut1FND.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FND);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFND = new ArrayList<DimensionalCut>();
        dimensionalCutsFND.add(dimensionalcut1FND);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FND = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FND.setDimensionMember(dimensionmember1Normal);
        dcm1FND.setDimensionalCut(dimensionalcut1FND);
        delegate.createDimensionalCutMember(dcm1FND);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFND[][] = {{3192D},
            {5533D},
            {3996D},
            {3053D},
            {4750D},
            {3001D},
            {4000D}
        };


        Double metaValuesFND[][] = {{4384D},
            {4384D},
            {4384D},
            {4384D},
            {4384D},
            {4384D},
            {4384D}
        };


        //Se crean las FECHAS

        List<Date> datesFND = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFND);
        System.out.println("Indicador: " + pointerFND.getName());
        for (int i = 0; i < datesFND.size(); i++) {
            System.out.println("Fecha Generada: " + datesFND.get(i));
            for (int j = 0; j < dimensionalCutsFND.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFND = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFND.setComparator(comparatorRFND);
                cdcRealFND.setDimensionalCut(dimensionalCutsFND.get(j));
                cdcRealFND.setRegisterDate(datesFND.get(i));
                cdcRealFND.setRegister(realValuesFND[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFND);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFND = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFND.setComparator(comparatorMFND);
                cdcMetaFND.setDimensionalCut(dimensionalCutsFND.get(j));
                cdcMetaFND.setRegisterDate(datesFND.get(i));
                cdcMetaFND.setRegister(metaValuesFND[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFND);

            }
        }
        //INDICADORES
        //---------------------------FIN FND--------------------------------------------------------------------------------------



        //---------------------------INDICADOR FSC--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFSC = (Pointer) Factory.getBean("Pointer");
        pointerFSC.setName("FS. Prevención del cólera");
        pointerFSC.setDescription("Detecciones de Vibrio Cholerae o 1 y su tratamiento oportuno");
        pointerFSC.setResponsable("Sergio Cruz");
        pointerFSC.setUnit("(Casos)");
        delegate.createPointer(pointerFSC);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFSC = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFSC.setScoreCard(pointerFSC);
        scorecarddimensionFSC.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFSC);

        //Populate a new Comparador Real
        Comparator comparatorRFSC = (Comparator) Factory.getBean("Comparator");
        comparatorRFSC.setDescription("Real");
        comparatorRFSC.setComparation(comparationReal);
        comparatorRFSC.setPointer(pointerFSC);
        delegate.createComparator(comparatorRFSC);

        //Populate a new Comparador Meta
        Comparator comparatorMFSC = (Comparator) Factory.getBean("Comparator");
        comparatorMFSC.setDescription("Meta");
        comparatorMFSC.setComparation(comparationGoal);
        comparatorMFSC.setPointer(pointerFSC);
        delegate.createComparator(comparatorMFSC);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFSC = delegate.findComparator(pointerFSC, comparationReal);
        Long idComparatorFSC = comparatorFSC.getIdComparator();

        //Create setting to that pointer
        Settings settingFSC = (Settings) Factory.getBean("Settings");
        settingFSC.setType(Settings.Type.SCORECARD);
        settingFSC.setTemporality(Settings.Temporality.LAST);
        settingFSC.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFSC.setMathOperation("P/" + "C" + idComparatorFSC);



        settingFSC.setScoreCard(pointerFSC);
        delegate.createSettings(settingFSC);

        pointerFSC.setSettings(settingFSC);
        delegate.updatePointer(pointerFSC);


        //Settings de los comparators

        List<Comparator> comparatorsFSC = delegate.findComparator(pointerFSC);
        for (Comparator comparator1 : comparatorsFSC) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FSC = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FSC.setPointer(pointerFSC);
        dimensionalcut1FSC.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FSC);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFSC = new ArrayList<DimensionalCut>();
        dimensionalCutsFSC.add(dimensionalcut1FSC);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FSC = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FSC.setDimensionMember(dimensionmember1Normal);
        dcm1FSC.setDimensionalCut(dimensionalcut1FSC);
        delegate.createDimensionalCutMember(dcm1FSC);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFSC[][] = {{7D},
            {6D},
            {4D},
            {4D},
            {4D},
            {2D},
            {3D}
        };


        Double metaValuesFSC[][] = {{3D},
            {3D},
            {3D},
            {3D},
            {3D},
            {3D},
            {3D}
        };



        //Se crean las FECHAS

        List<Date> datesFSC = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFSC);
        System.out.println("Indicador: " + pointerFSC.getName());
        for (int i = 0; i < datesFSC.size(); i++) {
            System.out.println("Fecha Generada: " + datesFSC.get(i));
            for (int j = 0; j < dimensionalCutsFSC.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFSC = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFSC.setComparator(comparatorRFSC);
                cdcRealFSC.setDimensionalCut(dimensionalCutsFSC.get(j));
                cdcRealFSC.setRegisterDate(datesFSC.get(i));
                cdcRealFSC.setRegister(realValuesFSC[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFSC);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFSC = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFSC.setComparator(comparatorMFSC);
                cdcMetaFSC.setDimensionalCut(dimensionalCutsFSC.get(j));
                cdcMetaFSC.setRegisterDate(datesFSC.get(i));
                cdcMetaFSC.setRegister(metaValuesFSC[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFSC);

            }
        }
        //INDICADORES
        //---------------------------FIN FSC--------------------------------------------------------------------------------------





        //---------------------------INDICADOR FNC--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerFNC = (Pointer) Factory.getBean("Pointer");
        pointerFNC.setName("FN. Prevención del cólera");
        pointerFNC.setDescription("Detecciones de Vibrio Cholerae o 1 y su tratamiento oportuno");
        pointerFNC.setResponsable("Sergio Cruz");
        pointerFNC.setUnit("($)");
        delegate.createPointer(pointerFNC);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionFNC = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionFNC.setScoreCard(pointerFNC);
        scorecarddimensionFNC.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionFNC);

        //Populate a new Comparador Real
        Comparator comparatorRFNC = (Comparator) Factory.getBean("Comparator");
        comparatorRFNC.setDescription("Real");
        comparatorRFNC.setComparation(comparationReal);
        comparatorRFNC.setPointer(pointerFNC);
        delegate.createComparator(comparatorRFNC);

        //Populate a new Comparador Meta
        Comparator comparatorMFNC = (Comparator) Factory.getBean("Comparator");
        comparatorMFNC.setDescription("Meta");
        comparatorMFNC.setComparation(comparationGoal);
        comparatorMFNC.setPointer(pointerFNC);
        delegate.createComparator(comparatorMFNC);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorFNC = delegate.findComparator(pointerFNC, comparationReal);
        Long idComparatorFNC = comparatorFNC.getIdComparator();

        //Create setting to that pointer
        Settings settingFNC = (Settings) Factory.getBean("Settings");
        settingFNC.setType(Settings.Type.SCORECARD);
        settingFNC.setTemporality(Settings.Temporality.LAST);
        settingFNC.setFrecuency(Settings.Frecuency.MONTHLY);
        settingFNC.setPolarity(Settings.Polarity.SPECIAL);
        settingFNC.setMathOperation("C" + idComparatorFNC + "/P");
        settingFNC.setSpecialOperation("2-C" + idComparatorFNC + "/P");



        settingFNC.setScoreCard(pointerFNC);
        delegate.createSettings(settingFNC);

        pointerFNC.setSettings(settingFNC);
        delegate.updatePointer(pointerFNC);


        //Settings de los comparators

        List<Comparator> comparatorsFNC = delegate.findComparator(pointerFNC);
        for (Comparator comparator1 : comparatorsFNC) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1FNC = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1FNC.setPointer(pointerFNC);
        dimensionalcut1FNC.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1FNC);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsFNC = new ArrayList<DimensionalCut>();
        dimensionalCutsFNC.add(dimensionalcut1FNC);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1FNC = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1FNC.setDimensionMember(dimensionmember1Normal);
        dcm1FNC.setDimensionalCut(dimensionalcut1FNC);
        delegate.createDimensionalCutMember(dcm1FNC);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesFNC[][] = {{9037D},
            {5540D},
            {5189D},
            {5681D},
            {8022D},
            {6700D},
            {5802D}
        };


        Double metaValuesFNC[][] = {{7870D},
            {7870D},
            {7870D},
            {7870D},
            {7870D},
            {7870D},
            {7870D}
        };



        //Se crean las FECHAS

        List<Date> datesFNC = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 1, 2011), ScoreCardUtils.generateDate(1, 7, 2011), pointerFNC);
        System.out.println("Indicador: " + pointerFNC.getName());
        for (int i = 0; i < datesFNC.size(); i++) {
            System.out.println("Fecha Generada: " + datesFNC.get(i));
            for (int j = 0; j < dimensionalCutsFNC.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealFNC = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealFNC.setComparator(comparatorRFNC);
                cdcRealFNC.setDimensionalCut(dimensionalCutsFNC.get(j));
                cdcRealFNC.setRegisterDate(datesFNC.get(i));
                cdcRealFNC.setRegister(realValuesFNC[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealFNC);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaFNC = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaFNC.setComparator(comparatorMFNC);
                cdcMetaFNC.setDimensionalCut(dimensionalCutsFNC.get(j));
                cdcMetaFNC.setRegisterDate(datesFNC.get(i));
                cdcMetaFNC.setRegister(metaValuesFNC[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaFNC);

            }
        }
        //INDICADORES
        //---------------------------FIN FNC--------------------------------------------------------------------------------------















        //INDICADORES
        //---------------------------INDICADOR O1_1_1--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerO1_1_1 = (Pointer) Factory.getBean("Pointer");
        pointerO1_1_1.setName("Mortalidad por enfermedades diarreicas en < 5 años total");
        pointerO1_1_1.setDescription("Número total de defunciones debidas a enfermedades diarreicas en menores de 5 años en un periodo determinado entre Total de población de menores de 5 años de ese mismo periodo por 100,000");
        pointerO1_1_1.setResponsable("Eduardo Romero");
        pointerO1_1_1.setUnit("(Tasa)");
        delegate.createPointer(pointerO1_1_1);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionO1_1_1 = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionO1_1_1.setScoreCard(pointerO1_1_1);
        scorecarddimensionO1_1_1.setDimension(dimensionRegiones);
        delegate.createScoreCardDimension(scorecarddimensionO1_1_1);

        //Populate a new Comparador Real
        Comparator comparatorRO1_1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorRO1_1_1.setDescription("Real");
        comparatorRO1_1_1.setComparation(comparationReal);
        comparatorRO1_1_1.setPointer(pointerO1_1_1);
        delegate.createComparator(comparatorRO1_1_1);

        //Populate a new Comparador Meta
        Comparator comparatorMO1_1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorMO1_1_1.setDescription("Meta");
        comparatorMO1_1_1.setComparation(comparationGoal);
        comparatorMO1_1_1.setPointer(pointerO1_1_1);
        delegate.createComparator(comparatorMO1_1_1);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorO1_1_1 = delegate.findComparator(pointerO1_1_1, comparationReal);
        Long idComparatorO1_1_1 = comparatorO1_1_1.getIdComparator();

        //Create setting to that pointer
        Settings settingO1_1_1 = (Settings) Factory.getBean("Settings");
        settingO1_1_1.setType(Settings.Type.SCORECARD);
        settingO1_1_1.setTemporality(Settings.Temporality.LAST);
        settingO1_1_1.setFrecuency(Settings.Frecuency.QUARTERLY);
        settingO1_1_1.setMathOperation("P/" + "C" + idComparatorO1_1_1);

        settingO1_1_1.setScoreCard(pointerO1_1_1);
        delegate.createSettings(settingO1_1_1);

        pointerO1_1_1.setSettings(settingO1_1_1);
        delegate.updatePointer(pointerO1_1_1);


        //Settings de los comparators

        List<Comparator> comparatorsO1_1_1 = delegate.findComparator(pointerO1_1_1);
        for (Comparator comparator1 : comparatorsO1_1_1) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1O1_1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1O1_1_1.setPointer(pointerO1_1_1);
        dimensionalcut1O1_1_1.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1O1_1_1);

        DimensionalCut dimensionalcut2O1_1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut2O1_1_1.setPointer(pointerO1_1_1);
        dimensionalcut2O1_1_1.setType(DimensionalCut.Type.STANDARD);
        delegate.createDimensionalCut(dimensionalcut2O1_1_1);

        DimensionalCut dimensionalcut3O1_1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut3O1_1_1.setPointer(pointerO1_1_1);
        dimensionalcut3O1_1_1.setType(DimensionalCut.Type.STANDARD);
        delegate.createDimensionalCut(dimensionalcut3O1_1_1);

        DimensionalCut dimensionalcut4O1_1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut4O1_1_1.setPointer(pointerO1_1_1);
        dimensionalcut4O1_1_1.setType(DimensionalCut.Type.STANDARD);
        delegate.createDimensionalCut(dimensionalcut4O1_1_1);

        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsO1_1_1 = new ArrayList<DimensionalCut>();
        dimensionalCutsO1_1_1.add(dimensionalcut1O1_1_1);
        dimensionalCutsO1_1_1.add(dimensionalcut2O1_1_1);
        dimensionalCutsO1_1_1.add(dimensionalcut3O1_1_1);
        dimensionalCutsO1_1_1.add(dimensionalcut4O1_1_1);


        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1O1_1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1O1_1_1.setDimensionMember(dimensionmember1Regiones);
        dcm1O1_1_1.setDimensionalCut(dimensionalcut1O1_1_1);
        delegate.createDimensionalCutMember(dcm1O1_1_1);

        DimensionalCutMember dcm2O1_1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm2O1_1_1.setDimensionMember(dimensionmember2Regiones);
        dcm2O1_1_1.setDimensionalCut(dimensionalcut2O1_1_1);
        delegate.createDimensionalCutMember(dcm2O1_1_1);

        DimensionalCutMember dcm3O1_1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm3O1_1_1.setDimensionMember(dimensionmember3Regiones);
        dcm3O1_1_1.setDimensionalCut(dimensionalcut3O1_1_1);
        delegate.createDimensionalCutMember(dcm3O1_1_1);

        DimensionalCutMember dcm4O1_1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm4O1_1_1.setDimensionMember(dimensionmember4Regiones);
        dcm4O1_1_1.setDimensionalCut(dimensionalcut4O1_1_1);
        delegate.createDimensionalCutMember(dcm4O1_1_1);

        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesO1_1_1[][] = {{1589.9999999999998D, 500.0D, 610.0D, 480.0D},
            {1480.0D, 480.0D, 550.0D, 450.0D},
            {1349.9999999999998D, 430.0D, 509.99999999999994D, 409.99999999999994D}
        };




        Double metaValuesO1_1_1[][] = {{1221.0D, 407.0D, 407.0D, 407.0D},
            {1221.0D, 407.0D, 407.0D, 407.0D},
            {1221.0D, 407.0D, 407.0D, 407.0D}
        };

        //Se crean las FECHAS


        List<Date> datesO1_1_1 = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 12, 2010), ScoreCardUtils.generateDate(1, 7, 2011), pointerO1_1_1);

        for (int i = 0; i < datesO1_1_1.size(); i++) {
            for (int j = 0; j < dimensionalCutsO1_1_1.size(); j++) {
                System.out.println("Fecha Generada: " + datesO1_1_1.get(i));

                //Valor Real
                ComparatorDimensionalCut cdcRealO1_1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealO1_1_1.setComparator(comparatorRO1_1_1);
                cdcRealO1_1_1.setDimensionalCut(dimensionalCutsO1_1_1.get(j));
                cdcRealO1_1_1.setRegisterDate(datesO1_1_1.get(i));
                cdcRealO1_1_1.setRegister(realValuesO1_1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealO1_1_1);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaO1_1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaO1_1_1.setComparator(comparatorMO1_1_1);
                cdcMetaO1_1_1.setDimensionalCut(dimensionalCutsO1_1_1.get(j));
                cdcMetaO1_1_1.setRegisterDate(datesO1_1_1.get(i));
                cdcMetaO1_1_1.setRegister(metaValuesO1_1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaO1_1_1);

            }
        }
        //INDICADORES
        //---------------------------FIN INDICADOR O1_1_1--------------------------------------------------------------------------------------





        //---------------------------INDICADOR O2_1_1--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerO2_1_1 = (Pointer) Factory.getBean("Pointer");
        pointerO2_1_1.setName("Prevalencia de desnutrición moderada y grave en menores de 5 años total");
        pointerO2_1_1.setDescription("Número de menores de 5 años que presentan desnutrición moderada y grave en un periodo determinado entre Total de población de menores de 5 años de ese periodo");
        pointerO2_1_1.setResponsable("Jorge Villagrán");
        pointerO2_1_1.setUnit("(Tasa)");
        delegate.createPointer(pointerO2_1_1);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionO2_1_1 = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionO2_1_1.setScoreCard(pointerO2_1_1);
        scorecarddimensionO2_1_1.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionO2_1_1);

        //Populate a new Comparador Real
        Comparator comparatorRO2_1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorRO2_1_1.setDescription("Real");
        comparatorRO2_1_1.setComparation(comparationReal);
        comparatorRO2_1_1.setPointer(pointerO2_1_1);
        delegate.createComparator(comparatorRO2_1_1);

        //Populate a new Comparador Meta
        Comparator comparatorMO2_1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorMO2_1_1.setDescription("Meta");
        comparatorMO2_1_1.setComparation(comparationGoal);
        comparatorMO2_1_1.setPointer(pointerO2_1_1);
        delegate.createComparator(comparatorMO2_1_1);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorO2_1_1 = delegate.findComparator(pointerO2_1_1, comparationReal);
        Long idComparatorO2_1_1 = comparatorO2_1_1.getIdComparator();

        //Create setting to that pointer
        Settings settingO2_1_1 = (Settings) Factory.getBean("Settings");
        settingO2_1_1.setType(Settings.Type.SCORECARD);
        settingO2_1_1.setTemporality(Settings.Temporality.LAST);
        settingO2_1_1.setFrecuency(Settings.Frecuency.QUARTERLY);
        settingO2_1_1.setMathOperation("P/" + "C" + idComparatorO2_1_1);



        settingO2_1_1.setScoreCard(pointerO2_1_1);
        delegate.createSettings(settingO2_1_1);

        pointerO2_1_1.setSettings(settingO2_1_1);
        delegate.updatePointer(pointerO2_1_1);


        //Settings de los comparators

        List<Comparator> comparatorsO2_1_1 = delegate.findComparator(pointerO2_1_1);
        for (Comparator comparator1 : comparatorsO2_1_1) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1O2_1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1O2_1_1.setPointer(pointerO2_1_1);
        dimensionalcut1O2_1_1.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1O2_1_1);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsO2_1_1 = new ArrayList<DimensionalCut>();
        dimensionalCutsO2_1_1.add(dimensionalcut1O2_1_1);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1O2_1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1O2_1_1.setDimensionMember(dimensionmember1Normal);
        dcm1O2_1_1.setDimensionalCut(dimensionalcut1O2_1_1);
        delegate.createDimensionalCutMember(dcm1O2_1_1);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesO2_1_1[][] = {{4.06D},
            {3.25D},
            {2.98D}
        };


        Double metaValuesO2_1_1[][] = {{2.15D},
            {2.15D},
            {2.15D}
        };



        //Se crean las FECHAS

        List<Date> datesO2_1_1 = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 12, 2010), ScoreCardUtils.generateDate(1, 7, 2011), pointerO2_1_1);
        System.out.println("Indicador: " + pointerO2_1_1.getName());
        for (int i = 0; i < datesO2_1_1.size(); i++) {
            System.out.println("Fecha Generada: " + datesO2_1_1.get(i));
            for (int j = 0; j < dimensionalCutsO2_1_1.size(); j++) {
                //Valor Real
                ComparatorDimensionalCut cdcRealO2_1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealO2_1_1.setComparator(comparatorRO2_1_1);
                cdcRealO2_1_1.setDimensionalCut(dimensionalCutsO2_1_1.get(j));
                cdcRealO2_1_1.setRegisterDate(datesO2_1_1.get(i));
                cdcRealO2_1_1.setRegister(realValuesO2_1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealO2_1_1);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaO2_1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaO2_1_1.setComparator(comparatorMO2_1_1);
                cdcMetaO2_1_1.setDimensionalCut(dimensionalCutsO2_1_1.get(j));
                cdcMetaO2_1_1.setRegisterDate(datesO2_1_1.get(i));
                cdcMetaO2_1_1.setRegister(metaValuesO2_1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaO2_1_1);

            }
        }
        //INDICADORES
        //---------------------------FIN O2_1_1---------------------------------------------------------------------------------





        //---------------------------INDICADOR O1_1--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerO1_1 = (Pointer) Factory.getBean("Pointer");
        pointerO1_1.setName("Porcentaje de Ocupantes en Viviendas sin Agua Entubada");
        pointerO1_1.setDescription("Promedio de ocupantes en las viviendas por viviendas sin servicio de agua entubada");
        pointerO1_1.setResponsable("Eduardo Romero");
        pointerO1_1.setUnit("(%)");
        delegate.createPointer(pointerO1_1);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionO1_1 = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionO1_1.setScoreCard(pointerO1_1);
        scorecarddimensionO1_1.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionO1_1);

        //Populate a new Comparador Real
        Comparator comparatorRO1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorRO1_1.setDescription("Real");
        comparatorRO1_1.setComparation(comparationReal);
        comparatorRO1_1.setPointer(pointerO1_1);
        delegate.createComparator(comparatorRO1_1);

        //Populate a new Comparador Meta
        Comparator comparatorMO1_1 = (Comparator) Factory.getBean("Comparator");
        comparatorMO1_1.setDescription("Meta");
        comparatorMO1_1.setComparation(comparationGoal);
        comparatorMO1_1.setPointer(pointerO1_1);
        delegate.createComparator(comparatorMO1_1);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorO1_1 = delegate.findComparator(pointerO1_1, comparationReal);
        Long idComparatorO1_1 = comparatorO1_1.getIdComparator();

        //Create setting to that pointer
        Settings settingO1_1 = (Settings) Factory.getBean("Settings");
        settingO1_1.setType(Settings.Type.SCORECARD);
        settingO1_1.setTemporality(Settings.Temporality.LAST);
        settingO1_1.setFrecuency(Settings.Frecuency.QUARTERLY);
        settingO1_1.setMathOperation("P/" + "C" + idComparatorO1_1);

        settingO1_1.setScoreCard(pointerO1_1);
        delegate.createSettings(settingO1_1);

        pointerO1_1.setSettings(settingO1_1);
        delegate.updatePointer(pointerO1_1);


        //Settings de los comparators

        List<Comparator> comparatorsO1_1 = delegate.findComparator(pointerO1_1);
        for (Comparator comparator1 : comparatorsO1_1) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1O1_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1O1_1.setPointer(pointerO1_1);
        dimensionalcut1O1_1.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1O1_1);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsO1_1 = new ArrayList<DimensionalCut>();
        dimensionalCutsO1_1.add(dimensionalcut1O1_1);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1O1_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1O1_1.setDimensionMember(dimensionmember1Normal);
        dcm1O1_1.setDimensionalCut(dimensionalcut1O1_1);
        delegate.createDimensionalCutMember(dcm1O1_1);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesO1_1[][] = {{38D},
            {34D},
            {35D}
        };

        Double metaValuesO1_1[][] = {{29.9D},
            {29.9D},
            {29.9D}
        };


        //Se crean las FECHAS

        List<Date> datesO1_1 = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 12, 2010), ScoreCardUtils.generateDate(1, 7, 2011), pointerO1_1);

        for (int i = 0; i < datesO1_1.size(); i++) {
            for (int j = 0; j < dimensionalCutsO1_1.size(); j++) {

                //Valor Real
                ComparatorDimensionalCut cdcRealO1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealO1_1.setComparator(comparatorRO1_1);
                cdcRealO1_1.setDimensionalCut(dimensionalCutsO1_1.get(j));
                cdcRealO1_1.setRegisterDate(datesO1_1.get(i));
                cdcRealO1_1.setRegister(realValuesO1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealO1_1);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaO1_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaO1_1.setComparator(comparatorMO1_1);
                cdcMetaO1_1.setDimensionalCut(dimensionalCutsO1_1.get(j));
                cdcMetaO1_1.setRegisterDate(datesO1_1.get(i));
                cdcMetaO1_1.setRegister(metaValuesO1_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaO1_1);

            }
        }
        //INDICADORES
        //---------------------------FIN O1_1--------------------------------------------------------------------------------------








        //---------------------------INDICADOR O2_1--------------------------------------------------------------------------------------
        //Populate a new KPI
        Pointer pointerO2_1 = (Pointer) Factory.getBean("Pointer");
        pointerO2_1.setName("Muertes provocadas por desnutrición");
        pointerO2_1.setDescription("Muertes por cada 100 mil habitantes");
        pointerO2_1.setResponsable("Jorge Villagrán");
        pointerO2_1.setUnit("(Tasa)");
        delegate.createPointer(pointerO2_1);

        //Populate a new IndDim
        ScoreCardDimension scorecarddimensionO2_1 = (ScoreCardDimension) Factory.getBean("ScoreCardDimension");
        scorecarddimensionO2_1.setScoreCard(pointerO2_1);
        scorecarddimensionO2_1.setDimension(dimensionNormal);
        delegate.createScoreCardDimension(scorecarddimensionO2_1);

        //Populate a new Comparador Real
        Comparator comparatorRO2_1 = (Comparator) Factory.getBean("Comparator");
        comparatorRO2_1.setDescription("Real");
        comparatorRO2_1.setComparation(comparationReal);
        comparatorRO2_1.setPointer(pointerO2_1);
        delegate.createComparator(comparatorRO2_1);

        //Populate a new Comparador Meta
        Comparator comparatorMO2_1 = (Comparator) Factory.getBean("Comparator");
        comparatorMO2_1.setDescription("Meta");
        comparatorMO2_1.setComparation(comparationGoal);
        comparatorMO2_1.setPointer(pointerO2_1);
        delegate.createComparator(comparatorMO2_1);

        //Settings
        //Find the scorecard and dimensionalCut

        Comparator comparatorO2_1 = delegate.findComparator(pointerO2_1, comparationReal);
        Long idComparatorO2_1 = comparatorO2_1.getIdComparator();

        //Create setting to that pointer
        Settings settingO2_1 = (Settings) Factory.getBean("Settings");
        settingO2_1.setType(Settings.Type.SCORECARD);
        settingO2_1.setTemporality(Settings.Temporality.LAST);
        settingO2_1.setFrecuency(Settings.Frecuency.QUARTERLY);
        settingO2_1.setMathOperation("P/" + "C" + idComparatorO2_1);

        settingO2_1.setScoreCard(pointerO2_1);
        delegate.createSettings(settingO2_1);

        pointerO2_1.setSettings(settingO2_1);
        delegate.updatePointer(pointerO2_1);


        //Settings de los comparators

        List<Comparator> comparatorsO2_1 = delegate.findComparator(pointerO2_1);
        for (Comparator comparator1 : comparatorsO2_1) {
            Settings settingComparator = (Settings) Factory.getBean("Settings");
            settingComparator.setType(Settings.Type.COMPARATOR);
            settingComparator.setCommand(Settings.Command.SUM);
            settingComparator.setComparator(comparator1);
            delegate.createSettings(settingComparator);

            comparator1.setSettings(settingComparator);
            delegate.updateComparator(comparator1);
        }



        //Populate DimensionalCut
        DimensionalCut dimensionalcut1O2_1 = (DimensionalCut) Factory.getBean("DimensionalCut");
        dimensionalcut1O2_1.setPointer(pointerO2_1);
        dimensionalcut1O2_1.setType(DimensionalCut.Type.TOTAL);
        delegate.createDimensionalCut(dimensionalcut1O2_1);



        //Se crea la lista de cortes del indicador
        List<DimensionalCut> dimensionalCutsO2_1 = new ArrayList<DimensionalCut>();
        dimensionalCutsO2_1.add(dimensionalcut1O2_1);



        //Populate DimensionalCut-DimensionalMember
        DimensionalCutMember dcm1O2_1 = (DimensionalCutMember) Factory.getBean("DimensionalCutMember");
        dcm1O2_1.setDimensionMember(dimensionmember1Normal);
        dcm1O2_1.setDimensionalCut(dimensionalcut1O2_1);
        delegate.createDimensionalCutMember(dcm1O2_1);


        //Se METEN LOS DATOS AL INDICADOR
        //SE CREAN las matrices de datos
        Double realValuesO2_1[][] = {{20D},
            {18D},
            {13D}
        };


        Double metaValuesO2_1[][] = {{8D},
            {8D},
            {8D}
        };


        //Se crean las FECHAS

        List<Date> datesO2_1 = ScoreCardUtils.generateDatesRange(ScoreCardUtils.generateDate(1, 12, 2010), ScoreCardUtils.generateDate(1, 7, 2011), pointerO2_1);

        for (int i = 0; i < datesO2_1.size(); i++) {
            for (int j = 0; j < dimensionalCutsO2_1.size(); j++) {

                //Valor Real
                ComparatorDimensionalCut cdcRealO2_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcRealO2_1.setComparator(comparatorRO2_1);
                cdcRealO2_1.setDimensionalCut(dimensionalCutsO2_1.get(j));
                cdcRealO2_1.setRegisterDate(datesO2_1.get(i));
                cdcRealO2_1.setRegister(realValuesO2_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcRealO2_1);

                //Valor Meta
                ComparatorDimensionalCut cdcMetaO2_1 = (ComparatorDimensionalCut) Factory.getBean("ComparatorDimensionalCut");
                cdcMetaO2_1.setComparator(comparatorMO2_1);
                cdcMetaO2_1.setDimensionalCut(dimensionalCutsO2_1.get(j));
                cdcMetaO2_1.setRegisterDate(datesO2_1.get(i));
                cdcMetaO2_1.setRegister(metaValuesO2_1[i][j]);
                delegate.createComparatorDimensionalCut(cdcMetaO2_1);

            }
        }
        //INDICADORES
        //---------------------------FIN O2_1--------------------------------------------------------------------------------------




        //---------------------------PROYECTO 1--------------------------------------------------------------------------------------

        //Create Project
        Project projectP1 = (Project) Factory.getBean("Project");
        projectP1.setName("Salud focalizada y diferenciada");
        projectP1.setDescription("Atención en salud focalizada y diferenciada para regiones, microrregiones, municipios y localidades por grado de marginación y vulnerabilidad.");
        projectP1.setResponsable("Gobierno de Oaxaca");
        delegate.createProject(projectP1);

        Tracer tracerBudgetP1 = (Tracer) Factory.getBean("Tracer");
        tracerBudgetP1.setName("Presupuesto");
        tracerBudgetP1.setPercentFactor(.5);
        tracerBudgetP1.setType(Tracer.Type.BUDGET);
        tracerBudgetP1.setProject(projectP1);
        delegate.createTracer(tracerBudgetP1);

        Tracer tracerProgressP1 = (Tracer) Factory.getBean("Tracer");
        tracerProgressP1.setName("Avance");
        tracerProgressP1.setPercentFactor(.5);
        tracerProgressP1.setType(Tracer.Type.PROGRESS);
        tracerProgressP1.setProject(projectP1);
        delegate.createTracer(tracerProgressP1);


        //HITO RAIZ
        //Create Label
        Label labelRootP1 = (Label) Factory.getBean("Label");
        labelRootP1.setName("Atención en salud focalizada y diferenciada");
        labelRootP1.setProject(projectP1);
        labelRootP1.setRoot(Boolean.TRUE);
        delegate.createLabel(labelRootP1);

        //Create Milestone 1
        Milestone milestoneP1_1 = (Milestone) Factory.getBean("Milestone");
        milestoneP1_1.setName("6.1O1E4L1 Combate a enfermedades infecciosas y medicina preventiva en microrregiones");
        //Fecha de 27-jun-11
        milestoneP1_1.setBeginDate(ScoreCardUtils.generateDate(1, 7, 2011));
        //Fecha de 01-jul-11
        milestoneP1_1.setEndDate(ScoreCardUtils.generateDate(15, 7, 2011));
        milestoneP1_1.setTask(labelRootP1);
        milestoneP1_1.setProject(projectP1);
        milestoneP1_1.setRoot(Boolean.FALSE);
        delegate.createMilestone(milestoneP1_1);

        //Create Milestone 2
        Milestone milestoneP1_2 = (Milestone) Factory.getBean("Milestone");
        milestoneP1_2.setName("6.1O1E4L2 Cobertura ampliada para atender enfermedades degenerativas");
        //Fecha de 04-jul-11
        milestoneP1_2.setBeginDate(ScoreCardUtils.generateDate(12, 7, 2011));
        //Fecha de 22-jul-11
        milestoneP1_2.setEndDate(ScoreCardUtils.generateDate(25, 7, 2011));
        milestoneP1_2.setTask(labelRootP1);
        milestoneP1_2.setProject(projectP1);
        milestoneP1_2.setRoot(Boolean.FALSE);
        delegate.createMilestone(milestoneP1_2);

        //Create Milestone 3
        Milestone milestoneP1_3 = (Milestone) Factory.getBean("Milestone");
        milestoneP1_3.setName("6.1O1E4L3 Amplia. de la cobertura y la modernizacion de la infraestructura de salud en municipios y localidades marginadas");
        //Fecha de 25-jul-11
        milestoneP1_3.setBeginDate(ScoreCardUtils.generateDate(25, 7, 2011));
        //Fecha de 19-ago-11
        milestoneP1_3.setEndDate(ScoreCardUtils.generateDate(30, 7, 2011));
        milestoneP1_3.setTask(labelRootP1);
        milestoneP1_3.setProject(projectP1);
        milestoneP1_3.setRoot(Boolean.FALSE);
        delegate.createMilestone(milestoneP1_3);


        //---------------------------PROYECTO 1--------------------------------------------------------------------------------------
        //MILESTONETRACERS!!!!
        //MileStone 1 Tracer Progress
        MilestoneTracer milestone1Tracer1 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone1Tracer1.setMilestone(milestoneP1_1);
        milestone1Tracer1.setTracer(tracerProgressP1);
        milestone1Tracer1.setRealValue(1D);

        //MileStone 1 Tracer Budget
        MilestoneTracer milestone1Tracer2 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone1Tracer2.setMilestone(milestoneP1_1);
        milestone1Tracer2.setTracer(tracerBudgetP1);
        milestone1Tracer2.setRealValue(1000D);
        milestone1Tracer2.setGoalValue(800D);

        //MileStone 2 Tracer Progress
        MilestoneTracer milestone2Tracer1 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone2Tracer1.setMilestone(milestoneP1_2);
        milestone2Tracer1.setTracer(tracerProgressP1);
        milestone2Tracer1.setRealValue(.9D);

        //MileStone 2 Tracer Budget
        MilestoneTracer milestone2Tracer2 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone2Tracer2.setMilestone(milestoneP1_2);
        milestone2Tracer2.setTracer(tracerBudgetP1);
        milestone2Tracer2.setRealValue(1000D);
        milestone2Tracer2.setGoalValue(1200D);

        //MileStone 3 Tracer Progress
        MilestoneTracer milestone3Tracer1 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone3Tracer1.setMilestone(milestoneP1_3);
        milestone3Tracer1.setTracer(tracerProgressP1);
        milestone3Tracer1.setRealValue(.3D);

        //MileStone 3 Tracer Budget
        MilestoneTracer milestone3Tracer2 = (MilestoneTracer) Factory.getBean("MilestoneTracer");
        milestone3Tracer2.setMilestone(milestoneP1_3);
        milestone3Tracer2.setTracer(tracerBudgetP1);
        milestone3Tracer2.setRealValue(1000D);
        milestone3Tracer2.setGoalValue(1100D);


        delegate.createMilestoneTracer(milestone1Tracer1);
        delegate.createMilestoneTracer(milestone1Tracer2);

        delegate.createMilestoneTracer(milestone2Tracer1);
        delegate.createMilestoneTracer(milestone2Tracer2);

        delegate.createMilestoneTracer(milestone3Tracer1);
        delegate.createMilestoneTracer(milestone3Tracer2);


        //------------------------FIN PROYECTO 1----------------------------------------------



        //FIN INDICADORES




        //OBJETIVOS
        //-----------------------------------------SE CREA EL OBJETIVO O1------------------------------------------------------------------
        //Create Objetive Scorecard
        Objective objectiveScorecardO1 = (Objective) Factory.getBean("Objective");
        objectiveScorecardO1.setName("O1 Ampliar la cobertura y mejorar la calidad de la infraestructura de servicios");
        objectiveScorecardO1.setDescription(" Ampliar la cobertura y mejorar la calidad de la infraestructura de servicios " +
                "básicos, energética, de comunicaciones y de transporte, para garantizar el acceso de los  habitantes de las " +
                "localidades rurales y urbanas a estos satisfactores así como para impulsar el desarrollo económico del estado, " +
                "aplicando una política de financiamiento e inversiones que incremente sustancialmente los recursos públicos y privados en el sector.");
        objectiveScorecardO1.setResponsable("Eduardo Romero");
        delegate.createObjective(objectiveScorecardO1);

        //-----------------------------------------FIN EL OBJETIVO O1------------------------------------------------------------------

        //-----------------------------------------SE CREA EL OBJETIVO O2------------------------------------------------------------------
        //Create Objetive Scorecard
        Objective objectiveScorecardO2 = (Objective) Factory.getBean("Objective");
        objectiveScorecardO2.setName("O1 Disminuir la incidencia y la severidad de la pobreza");
        objectiveScorecardO2.setDescription("Disminuir la incidencia y la severidad de la pobreza de las personas, familias y comunidades del estado, mediante la combinación de políticas, programas y ");
        objectiveScorecardO2.setResponsable("Eduardo Romero");
        delegate.createObjective(objectiveScorecardO2);

        //-----------------------------------------FIN EL OBJETIVO O2------------------------------------------------------------------



        //TEMAS!!!!!!
        //-----------------------------------------SE CREA EL TEMA 5.11--------------------------------------------
        //Create Theme Scorecard
        Theme themeScorecard5_11 = (Theme) Factory.getBean("Theme");
        themeScorecard5_11.setName("5.11 Ordenamiento territorial e infraestructuras");
        themeScorecard5_11.setDescription("5.11 Ordenamiento territorial e infraestructuras");
        themeScorecard5_11.setResponsable("Eduardo Romero");
        delegate.createTheme(themeScorecard5_11);



        //-----------------------------------------SE CREA EL TEMA 6.1--------------------------------------------
        //Create Theme Scorecard
        Theme themeScorecard6_1 = (Theme) Factory.getBean("Theme");
        themeScorecard6_1.setName("6.1 Combate a la pobreza, la desigualdad y la marginación");
        themeScorecard6_1.setDescription("6.1 Combate a la pobreza, la desigualdad y la marginación");
        themeScorecard6_1.setResponsable("Eduardo Romero");
        delegate.createTheme(themeScorecard6_1);


        //PERSPECTIVAS!!!!!
        //-----------------------------------------SE CREA LA PERSPECTIVA I--------------------------------------------
        //Create Perspective Scorecard
        Perspective perspectiveScorecardPerspectiveI = (Perspective) Factory.getBean("Perspective");
        perspectiveScorecardPerspectiveI.setName("I. ESTADO DE DERECHO, GOBERNABILIDAD Y SEGURIDAD.");
        perspectiveScorecardPerspectiveI.setDescription("Este eje aborda la problemática principal, las estrategias y las " +
                "líneas de acción asociadas principalmente con la función política y de justicia. Así, entre otros temas, en " +
                "este eje se aborda la gobernabilidad democrática, la colaboración entre los poderes, el fortalecimiento de la " +
                "autonomía indígena, el apoyo a los municipios, la procuración de justicia, la resolución de los conflictos " +
                "agrarios y la seguridad pública");
        delegate.createPerspective(perspectiveScorecardPerspectiveI);



        //-----------------------------------------SE CREA LA PERSPECTIVA II--------------------------------------------
        //Create Perspective Scorecard
        Perspective perspectiveScorecardPerspectiveII = (Perspective) Factory.getBean("Perspective");
        perspectiveScorecardPerspectiveII.setName("II. CRECIMIENTO ECONÓMICO, COMPETITIVIDAD Y EMPLEO");
        perspectiveScorecardPerspectiveII.setDescription("Este eje se orienta al fomento de la economía oaxaqueña para la atracción de inversiones, la generación de empleos " +
                "y el fortalecimiento a la competitividad. Además, se plantean las estrategias y líneas de acción relativas al " +
                "fortalecimiento de los sectores conómicos estratégicos, la innovación y desarrollo tecnológico, la construcción " +
                "de infraestructura y la formulación de proyectos comunitarios consistentes con los valores e identidad de las culturas originarias, principalmente");
        perspectiveScorecardPerspectiveII.setResponsable("Gobierno de Oaxaca");
        delegate.createPerspective(perspectiveScorecardPerspectiveII);

        //-----------------------------------------FIN PERSPECTIVA II--------------------------------------------------


        //-----------------------------------------SE CREA LA PERSPECTIVA III--------------------------------------------
        //Create Perspective Scorecard
        Perspective perspectiveScorecardPerspectiveIII = (Perspective) Factory.getBean("Perspective");
        perspectiveScorecardPerspectiveIII.setName("III. DESARROLLO SOCIAL Y HUMANO");
        perspectiveScorecardPerspectiveIII.setDescription("Este eje revela detalladamente las condiciones de vida " +
                "de la población oaxaqueña en términos de salud, educación, nutrición, desarrollo cultural, pobreza, " +
                "desigualdad, marginación y vulnerabilidad. Asimismo, plantea las estrategias y líneas de acción orientadas" +
                " a mejorar las condiciones de vida de la población mediante la ampliación de capacidades, el acceso a " +
                "los servicios públicos básicos y la generación de oportunidades para impulsar el desarrollo humano y social.");
        perspectiveScorecardPerspectiveIII.setResponsable("Gobierno de Oaxaca");
        delegate.createPerspective(perspectiveScorecardPerspectiveIII);

        //-----------------------------------------FIN PERSPECTIVA III--------------------------------------------------


        //-----------------------------------------SE CREA LA PERSPECTIVA IV--------------------------------------------
        //Create Perspective Scorecard
        Perspective perspectiveScorecardPerspectiveIV = (Perspective) Factory.getBean("Perspective");
        perspectiveScorecardPerspectiveIV.setName("IV. GOBIERNO HONESTO Y DE RESULTADOS.");
        perspectiveScorecardPerspectiveIV.setDescription("Este eje busca atender el compromiso del actual gobierno de impulsar una " +
                "forma de gobernar democrática, moderna, transparente y, sobre todo, efectiva, con una clara orientación a resultados. " +
                "En este sentido, es de la mayor relevancia la existencia de mecanismos de transparencia y rendición de cuentas que permitan " +
                "evaluar los alcances y resultados que la política gubernamental. Este eje incluye diagnósticos, estrategias y líneas de " +
                "acción en temas como el combate a la corrupción, el fortalecimiento de las finanzas públicas, la coordinación institucional " +
                "y la vocación del servicio público en beneficio de la población.");
        delegate.createPerspective(perspectiveScorecardPerspectiveIV);


        //-----------------------------------------SE CREA EL MAPA DE OAXACA--------------------------------------------
        //Create Perspective Scorecard
        //Create Map Scorecard
        Map mapScorecard = (Map) Factory.getBean("Map");
        mapScorecard.setName("Programa Estatal de Desarrollo");
        mapScorecard.setDescription("Plan Estatal de Desarrollo");
        mapScorecard.setResponsable("Gobierno de Oaxaca");
        delegate.createMap(mapScorecard);

        //-----------------------------------------FIN DE MAPA DE OAXACA---------------------------------------------------



        //-----------------------------------------SE CREA EL MAPA DE OAXACA SS--------------------------------------------
        //Create Perspective Scorecard
        //Create Map Scorecard
        Map mapScorecardSS = (Map) Factory.getBean("Map");
        mapScorecardSS.setName("Secretaría de Salud");
        mapScorecardSS.setDescription("Mapa de la Secretaria de Salud");
        mapScorecardSS.setResponsable("Gobierno de Oaxaca");
        delegate.createMap(mapScorecardSS);

        //-----------------------------------------FIN DE MAPA DE OAXACA SS---------------------------------------------------



        //---------------------------------------------------RELACIONES DE SCORECARDS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


        //MAPA SS CON SUS PERSPECTIVAS

        ScoreCardRelation scoreCardRelationMSS_PII = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationMSS_PII.setScoreCard(mapScorecardSS);
        scoreCardRelationMSS_PII.setOtherScoreCard(perspectiveScorecardPerspectiveII);
        scoreCardRelationMSS_PII.setPercentFactor(.50D);
        delegate.createScoreCardRelation(scoreCardRelationMSS_PII);

        ScoreCardRelation scoreCardRelationMSS_PIII = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationMSS_PIII.setScoreCard(mapScorecardSS);
        scoreCardRelationMSS_PIII.setOtherScoreCard(perspectiveScorecardPerspectiveIII);
        scoreCardRelationMSS_PIII.setPercentFactor(.50D);
        delegate.createScoreCardRelation(scoreCardRelationMSS_PIII);


        //MAPA PED CON SUS PERSPECTIVAS

        ScoreCardRelation scoreCardRelationM_PI = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationM_PI.setScoreCard(mapScorecard);
        scoreCardRelationM_PI.setOtherScoreCard(perspectiveScorecardPerspectiveI);
        scoreCardRelationM_PI.setPercentFactor(0D);
        delegate.createScoreCardRelation(scoreCardRelationM_PI);

        ScoreCardRelation scoreCardRelationM_PII = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationM_PII.setScoreCard(mapScorecard);
        scoreCardRelationM_PII.setOtherScoreCard(perspectiveScorecardPerspectiveII);
        scoreCardRelationM_PII.setPercentFactor(.50D);
        delegate.createScoreCardRelation(scoreCardRelationM_PII);

        ScoreCardRelation scoreCardRelationM_PIII = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationM_PIII.setScoreCard(mapScorecard);
        scoreCardRelationM_PIII.setOtherScoreCard(perspectiveScorecardPerspectiveIII);
        scoreCardRelationM_PIII.setPercentFactor(.50D);
        delegate.createScoreCardRelation(scoreCardRelationM_PIII);

        ScoreCardRelation scoreCardRelationM_PIV = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationM_PIV.setScoreCard(mapScorecard);
        scoreCardRelationM_PIV.setOtherScoreCard(perspectiveScorecardPerspectiveIV);
        scoreCardRelationM_PIV.setPercentFactor(0D);
        delegate.createScoreCardRelation(scoreCardRelationM_PIV);

        // PERSPECTIVA II CON SUS TEMAS

        ScoreCardRelation scoreCardRelationII_5_11 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationII_5_11.setScoreCard(perspectiveScorecardPerspectiveII);
        scoreCardRelationII_5_11.setOtherScoreCard(themeScorecard5_11);
        scoreCardRelationII_5_11.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelationII_5_11);



        // PERSPECTIVA III CON SUS TEMAS

        ScoreCardRelation scoreCardRelationIII_6_1 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationIII_6_1.setScoreCard(perspectiveScorecardPerspectiveIII);
        scoreCardRelationIII_6_1.setOtherScoreCard(themeScorecard6_1);
        scoreCardRelationIII_6_1.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelationIII_6_1);

        // EL TEMA 5.11 CON SUS OBJETIVOS

        ScoreCardRelation scoreCardRelation5_11_O1 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelation5_11_O1.setScoreCard(themeScorecard5_11);
        scoreCardRelation5_11_O1.setOtherScoreCard(objectiveScorecardO1);
        scoreCardRelation5_11_O1.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelation5_11_O1);


        // EL TEMA 6.1 CON SUS OBJETIVOS

        ScoreCardRelation scoreCardRelation6_1_O2 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelation6_1_O2.setScoreCard(themeScorecard6_1);
        scoreCardRelation6_1_O2.setOtherScoreCard(objectiveScorecardO2);
        scoreCardRelation6_1_O2.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelation6_1_O2);


        // EL OBJETIVO O1 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO1_O1_1 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO1_O1_1.setScoreCard(objectiveScorecardO1);
        scoreCardRelationO1_O1_1.setOtherScoreCard(pointerO1_1);
        scoreCardRelationO1_O1_1.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelationO1_O1_1);


        // EL OBJETIVO O2 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO2_O2_1 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO2_O2_1.setScoreCard(objectiveScorecardO2);
        scoreCardRelationO2_O2_1.setOtherScoreCard(pointerO2_1);
        scoreCardRelationO2_O2_1.setPercentFactor(.8D);
        delegate.createScoreCardRelation(scoreCardRelationO2_O2_1);

        ScoreCardRelation scoreCardRelationO2_projectP1 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO2_projectP1.setScoreCard(objectiveScorecardO2);
        scoreCardRelationO2_projectP1.setOtherScoreCard(projectP1);
        scoreCardRelationO2_projectP1.setPercentFactor(.2D);
        delegate.createScoreCardRelation(scoreCardRelationO2_projectP1);

        // EL INDICADOR O1_1 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO11_O111 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO11_O111.setScoreCard(pointerO1_1);
        scoreCardRelationO11_O111.setOtherScoreCard(pointerO1_1_1);
        scoreCardRelationO11_O111.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelationO11_O111);


        // EL INDICADOR O2_1 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO21_O111 = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO21_O111.setScoreCard(pointerO2_1);
        scoreCardRelationO21_O111.setOtherScoreCard(pointerO2_1_1);
        scoreCardRelationO21_O111.setPercentFactor(1D);
        delegate.createScoreCardRelation(scoreCardRelationO21_O111);




        // EL INDICADOR O1_1_1 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO111_FSA = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO111_FSA.setScoreCard(pointerO1_1_1);
        scoreCardRelationO111_FSA.setOtherScoreCard(pointerFSA);
        scoreCardRelationO111_FSA.setPercentFactor(.5D);
        delegate.createScoreCardRelation(scoreCardRelationO111_FSA);


        ScoreCardRelation scoreCardRelationO111_FNA = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO111_FNA.setScoreCard(pointerO1_1_1);
        scoreCardRelationO111_FNA.setOtherScoreCard(pointerFNA);
        scoreCardRelationO111_FNA.setPercentFactor(.5D);
        delegate.createScoreCardRelation(scoreCardRelationO111_FNA);


        //EL INDICADOR O2_1_1 CON SUS INDICADORES

        ScoreCardRelation scoreCardRelationO211_FSD = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO211_FSD.setScoreCard(pointerO2_1_1);
        scoreCardRelationO211_FSD.setOtherScoreCard(pointerFSD);
        scoreCardRelationO211_FSD.setPercentFactor(.25D);
        delegate.createScoreCardRelation(scoreCardRelationO211_FSD);


        ScoreCardRelation scoreCardRelationO211_FND = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO211_FND.setScoreCard(pointerO2_1_1);
        scoreCardRelationO211_FND.setOtherScoreCard(pointerFND);
        scoreCardRelationO211_FND.setPercentFactor(.25D);
        delegate.createScoreCardRelation(scoreCardRelationO211_FND);

        ScoreCardRelation scoreCardRelationO211_FSC = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO211_FSC.setScoreCard(pointerO2_1_1);
        scoreCardRelationO211_FSC.setOtherScoreCard(pointerFSC);
        scoreCardRelationO211_FSC.setPercentFactor(.25D);
        delegate.createScoreCardRelation(scoreCardRelationO211_FSC);

        ScoreCardRelation scoreCardRelationO211_FNC = (ScoreCardRelation) Factory.getBean("ScoreCardRelation");
        scoreCardRelationO211_FNC.setScoreCard(pointerO2_1_1);
        scoreCardRelationO211_FNC.setOtherScoreCard(pointerFNC);
        scoreCardRelationO211_FNC.setPercentFactor(.25D);
        delegate.createScoreCardRelation(scoreCardRelationO211_FNC);


        //Create a Person
        //Create a Designer
        Person personDesigner = (Person) Factory.getBean("Person");
        personDesigner.setName("Usuario Diseñador");
        personDesigner.setEmail("malp17@gmail.com");
        personDesigner.setUsername("designer");
        personDesigner.setPassword("designer");
        personDesigner.setProfile(Person.Profile.DESIGNER);
        delegate.createPerson(personDesigner);


        Person person = (Person) Factory.getBean("Person");
        person.setName("Usuario Demo");
        person.setEmail("malp17@gmail.com");
        person.setUsername("demouser");
        person.setPassword("demouser");
        person.setProfile(Person.Profile.NORMAL_USER);
        delegate.createPerson(person);



        //Se crea el dominio designer
        ScoreDomain scoreDomainDesigner = (ScoreDomain) Factory.getBean("ScoreDomain");
        scoreDomainDesigner.setName("Dominio de Administradores");
        delegate.createScoreDomain(scoreDomainDesigner);

        //Se crea el dominio
        ScoreDomain scoreDomain = (ScoreDomain) Factory.getBean("ScoreDomain");
        scoreDomain.setName("Dominio PED - Oaxaca");
        delegate.createScoreDomain(scoreDomain);

        //Se crea el dominio
        ScoreDomain scoreDomainSS = (ScoreDomain) Factory.getBean("ScoreDomain");
        scoreDomainSS.setName("Dominio SS - Oaxaca");
        delegate.createScoreDomain(scoreDomainSS);

    }
}
